"use strict";
var url = require("url");
var qs = require("querystring");

function query(req, res, next) {
    var queryString = url.parse(req.url).query; //请求部分参数
    if (queryString) {
        var queryObject = qs.parse(queryString); //转换为json
        req.query = queryObject; //赋值
    }

    next();
}

module.exports = query;
